# Contributor: mio <miyopan@e.email>
# Maintainer: mio <miyopan@e.email>
pkgname=leocad
pkgver=21.06
_libver=20.03
pkgrel=0
pkgdesc="CAD application for creating virtual LEGO models"
url="https://www.leocad.org/"
license="GPL-2.0-only"
arch="all"
makedepends="qt5-qtbase-dev qt5-qttools-dev zlib-dev"
subpackages="$pkgname-doc"
source="https://github.com/leozide/leocad/archive/v$pkgver/leocad-v$pkgver.tar.gz
	https://github.com/leozide/leocad/releases/download/v$pkgver/Library-$_libver.zip
	"
options="!check" # No tests

build() {
	DISABLE_UPDATE_CHECK=1 LDRAW_LIBRARY_PATH=/usr/share/leocad \
		qmake-qt5 leocad.pro
	make
}

package() {
	INSTALL_ROOT="$pkgdir" make install
	# Install parts library
	mkdir -p "$pkgdir"/usr/share/leocad
	mv "$srcdir"/library.bin "$pkgdir"/usr/share/leocad/
}
sha512sums="
6cc868d3da15f9fe003a70d3a8ebaf2b4e6562a8728652cb7fc9e3ab5ddd9a90c5e433fd4d37cc9f972dc314399b4edb34fe5d9cd47ad63bf7c5d71e04e3c662  leocad-v21.06.tar.gz
b339a07cb1e9fc5a35f108bba915a0363361b295ba82980550b7b4f82eaa43be45187cb6084cf123c65b52b2d89038c8abab847d0933f6166cac59404dda671a  Library-20.03.zip
"
